﻿<UserControl x:Class="Mengsk.ERP.App.Orders.OrderView.OrderViewUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="800" xmlns:my="clr-namespace:Mengsk.ERP.App.Orders">
    
    <TabControl >
        <TabItem Header="扫描分析">
            <Grid >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="120"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0" Text="查询条件:" Margin="3" VerticalAlignment="Center" FontSize="16" Grid.ColumnSpan="3"/>
                <TextBlock Grid.Row="1" Grid.Column="0" Text="QQ号码:" Margin="3" VerticalAlignment="Center"/>
                <TextBox Grid.Row="1" Grid.Column="1" Name="tbName" Margin="3" PreviewKeyDown="tbName_PreviewKeyDown"/>
                <TextBlock Grid.Row="1" Grid.Column="2" Text="物流编号:" Margin="3" VerticalAlignment="Center"/>
                <TextBox Grid.Row="1" Grid.Column="3" Name="tbDeliveryNumber" Margin="3" PreviewKeyDown="tbDeliveryNumber_PreviewKeyDown"/>
                <TextBlock Grid.Row="1" Grid.Column="4" Text="快递公司:" Margin="3" VerticalAlignment="Center"/>
                <ComboBox Grid.Row="1" Grid.Column="5" Margin="3" VerticalAlignment="Center" Name="cbbDeliveryCompany">
                    <ComboBoxItem>圆通速递</ComboBoxItem>
                    <ComboBoxItem>宅急送</ComboBoxItem>
                    <ComboBox.SelectedIndex>0</ComboBox.SelectedIndex>
                </ComboBox>

                <TextBlock Grid.Row="2" Grid.Column="0" Text="统计结果:" Margin="3" VerticalAlignment="Center" FontSize="16" Grid.ColumnSpan="3"/>
                
                <TextBlock Grid.Row="3" Grid.Column="0" Text="等待发货:" Margin="3" VerticalAlignment="Center"/>
                <TextBox Grid.Row="3" Grid.Column="1" Name="tbWaitShip" Margin="3" IsReadOnly="True"/>
                <TextBlock Grid.Row="3" Grid.Column="2" Margin="3" Text="已经发货:" VerticalAlignment="Center"/>
                <TextBox Grid.Row="3" Grid.Column="3" Margin="3" Name="tbShipOK" IsReadOnly="True"/>
                <TextBlock Grid.Row="3" Grid.Column="4" Margin="3" Text="已经签收:" VerticalAlignment="Center"/>
                <TextBox Grid.Row="3" Grid.Column="5" Margin="3" Name="tbSign" IsReadOnly="True"/>
                
                <TextBlock Grid.Row="4" Grid.Column="0" Text="已经返款:" Margin="3" VerticalAlignment="Center"/>
                <TextBox Grid.Row="4" Grid.Column="1" Name="tbSucess" Margin="3" IsReadOnly="True"/>
                <TextBlock Grid.Row="4" Grid.Column="2" Text="拒收未返:" Margin="3" VerticalAlignment="Center"/>
                <TextBox Grid.Row="4" Grid.Column="3" Name="tbRefuseNotReturn" Margin="3" IsReadOnly="True"/>
                <TextBlock Grid.Row="4" Grid.Column="4" Text="拒收已返:" Margin="3" VerticalAlignment="Center"/>
                <TextBox Grid.Row="4" Grid.Column="5" Name="tbRefuseReturned" Margin="3" IsReadOnly="True"/>
                <TextBlock Grid.Row="5" Grid.Column="0" Text="拒签率:" Margin="3" VerticalAlignment="Center" FontSize="16"/>
                <TextBox Grid.Row="5" Grid.Column="1" Name="tbRefusedCal" Margin="3" IsReadOnly="True"/>
                <TextBlock Grid.Row="5" Grid.Column="2" Text="签收率:" Margin="3" VerticalAlignment="Center" FontSize="16"/>
                <TextBox Grid.Row="5" Grid.Column="3" Name="tbAccpetCal" Margin="3" IsReadOnly="True"/>
                <TextBlock Grid.Row="5" Grid.Column="4" Text="总数:" Name="tbScanTotal" Margin="3" FontSize="14" VerticalAlignment="Center"/>
                
                <Button Grid.Row="5" Grid.Column="5" Name="btnClear" Margin="3" VerticalAlignment="Center" Content="清空" Click="btnClear_Click" />
                <my:OrderDetailUserControl Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="7" x:Name="scanOrderDetailUserControl"/>
            </Grid>
        </TabItem>
        <TabItem Header="按照下单日期分析">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

                <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="3">
                    <TextBlock Text="请选择下单日期" Margin="3" VerticalAlignment="Center"/>
                    <DatePicker Name="dpDate" Margin="3" Width="120" VerticalAlignment="Center"/>
                    <Button Name="btnQuery" Margin="3" Content="查询" VerticalAlignment="Center" Width="60" Click="btnQuery_Click" />
                </StackPanel>
                <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="3">
                    <TextBlock Text="标记发货总数:" VerticalAlignment="Center" Margin="3"/>
                    <TextBlock Name="tbTotal" VerticalAlignment="Center" Margin="3" Width="60"/>
                    <TextBlock Text="拒签率(拒收/货到付款总数*100):" VerticalAlignment="Center" Margin="3"/>
                    <TextBlock Name="tbRefused" VerticalAlignment="Center" Margin="3" Width="60"/>
                    <TextBlock Text="签收率(返款数量+签收数量/发货数量*100):" VerticalAlignment="Center" Margin="3"/>
                    <TextBlock Name="tbAccept" VerticalAlignment="Center" Margin="3" Width="60"/>
                </StackPanel>

                <Grid Grid.Row="3" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="150"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>

                    <StackPanel Orientation="Vertical" Margin="3">
                        <Button Name="btnWaitShip" Content="等待发货" VerticalAlignment="Center" Margin="3" Click="btnWaitShip_Click"/>
                        <Button Name="btnShipOK" Content="已经发货" VerticalAlignment="Center" Margin="3" Click="btnShipOK_Click"/>
                        <Button Name="btnSign" Content="已经签收" VerticalAlignment="Center" Margin="3" Click="btnSign_Click"/>
                        <Button Name="btnSucess" Content="已经返款" VerticalAlignment="Center" Margin="3" Click="btnSucess_Click"/>
                        <Button Name="btnRefusedReturned" Content="拒收已返回" VerticalAlignment="Center" Margin="3" Click="btnRefusedReturned_Click"/>
                        <Button Name="btnRefusedNotReturned" Content="拒收未返回" VerticalAlignment="Center" Margin="3" Click="btnRefusedNotReturned_Click"/>
                        <Button Name="btnEmptyDelivery" Content="没有物流单号" VerticalAlignment="Center" Margin="3" Click="btnEmptyDelivery_Click"/>
                        <Button Name="btnDeliveryDuplicate" Content="物流订单重复" VerticalAlignment="Center" Margin="3" Click="btnDeliveryDuplicate_Click"/>
                    </StackPanel>

                    <DockPanel Grid.Column="1" LastChildFill="True" >
                        <TextBlock Name="tbCurrentView" Margin="3" FontSize="24" DockPanel.Dock="Top">
                        </TextBlock>
                        <my:OrderDetailUserControl Grid.Column="1" x:Name="orderDetailUserControl1"/>
                    </DockPanel>

                </Grid>
            </Grid>
        </TabItem>
        
        <TabControl.SelectedIndex>0</TabControl.SelectedIndex>
    </TabControl>

</UserControl>
